<extend name="Public/base" />

<block name="style">
    <link href="__STATIC__/iCheck/skins/flat/green.css" rel="stylesheet">
</block>
<block name="body">

    <div class="right_col" role="main">
        <div class="">



            <div class="page-title">
                <div class="title_left">
                    <h3>{$meta_title} <small>Some examples to get you started</small></h3>
                </div>

                <div class="title_right">
<!--                    <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="Search for...">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button">Go!</button>
                            </span>
                        </div>
                    </div>-->
                </div>
            </div>

            <div class="clearfix"></div>
           




            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  


                    <div class="x_content">

  <form id="export-form" method="post" action="{:U('export')}">
                        <div class="table-responsive">
                            <table class="table table-striped jambo_table bulk_action">
                                <thead>
                                    <tr class="headings">
                                       
                                        <th class="column-title">备份名称 </th>
                                        <th class="column-title">卷数 </th>
                                        <th class="column-title">压缩 </th>
                                        <th class="column-title">数据大小 </th>
                                        
                                        <th class="column-title">备份时间 </th>
                                      <th class="column-title">状态 </th>
                                        <th class="column-title no-link last"><span class="nobr">操作</span>
                                        </th>
                                        <th class="bulk-actions" colspan="6">
                                            <a class="antoo" style="color:#fff; font-weight:500;">Bulk Actions ( <span class="action-cnt"> </span> ) <i class="fa fa-chevron-down"></i></a>
                                        </th>
                                    </tr>
                                </thead>

                                <tbody>

                                <notempty name="list">
    <volist name='list' id='data'> 
                                    <tr class="even pointer  del_id_{$data.time|date='Ymd-His',###}">
                                        
                                         <td>{$data.time|date='Ymd-His',###}</td>
                            <td>{$data.part}</td>
                            <td>{$data.compress}</td>
                            <td>{$data.size|format_bytes}</td>
                            <td >{$key}</td>
                             <td>-</td>
                                        <td>
                                            <a href="{:U('importDate?time='.$data['time'])}" class="btn btn-info btn-xs db-import"><i class="fa fa-pencil"></i>还原</a>
                                           <a href="{:U('del?time='.$data['time'])}" class="btn btn-danger btn-xs  del_common_tr"><i class="fa fa-trash-o"></i>删除</a>
                                        </td>
                                    </tr>
    </volist>
                                    <else /> 
                                <tr class="even pointer  del_id_{$vo.id}">
                                <td  colspan="9">
                                    无相关记录
                                     </td>
                                        </tr>
                                </notempty>
                                </tbody>
                            </table>
                        </div>
        </form>


                                 
                    </div>    
                </div>   
            </div>
            
            
            
            
            
            
            
        </div>
    </div>
</div>
<block name="script">
 <script type="text/javascript">
 <script type="text/javascript">
    (function($){
         $(".db-import").click(function(){
            var self = this, status = ".";
            $.get(self.href, success, "json");
            window.onbeforeunload = function(){ return "正在还原数据库，请不要关闭！" }
            return false;
        
            function success(data){
               
                if(data.code){
                    if(data.gz){
                        data.msg += status;
                        if(status.length === 5){
                            status = ".";
                        } else {
                            status += ".";
                        }
                    }
                    $(self).parent().prev().text(data.msg);
                    if(data.data.part){
                        $.get(self.href, 
                            {"part" : data.data.part, "start" : data.data.start}, 
                            success, 
                            "json"
                        );
                    }  else {
                        window.onbeforeunload = function(){ return null; }
                    }
                } else {
                    ui.error(data.msg);
                }
            }
        });
       
    })(jQuery);
    </script>
    <script src="__STATIC__/iCheck/icheck.min.js"></script>
    <script>
        Lzy.highlight_subnav('{:U('index?type=import')}');
    </script>
</block>